package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import com.zzyl.vo.AlertRuleVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.zzyl.base.ResponseResult.success;

@RestController
@RequestMapping("/alert-data")
@Api(tags = "告警数据管理")
public class AlertDataController {

    @Autowired
    private AlertDataService alertDataService;

    @GetMapping("/pageQuery")
    @ApiOperation("分页查询告警数据")
    public ResponseResult<AlertDataVo> pageQuery(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                 @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
        PageResponse pageResponse = alertDataService.pageQuery(pageSize, pageNum);
        return success(pageResponse);
    }
}
